import 'package:freedom/entity/restful.dart';

abstract class AbstractResult<T> extends Object {
  static Map<String, AbstractResult> DECODE = {};

  T formJSON(Map<String, dynamic> jsonRes);

  /**
   * 需要自定义的返回结果集
   */

  static AbstractResult? checkType(data, type) {
    if (type == Restful) {
      return Restful.fromJson(data!);
    }
    return null;
  }
}
